﻿@page "/privacyLibrary"
@namespace SwashbucklerDiary.Rcl.Pages
@inherits DiariesPageComponentBase

<MyAppBar>
    <MButton Icon="true"
             OnClick="NavigateToBack">
        <MIcon>
            mdi-arrow-left
        </MIcon>
    </MButton>

    <SearchTextField @bind-Visible="showSearch"
                     @bind-Value="search"
                     Title="@(I18n.T("Setting.Safe.PrivacyLibrary.Name"))"
                     OnInput="UpdateDiariesAsync">
    </SearchTextField>

    <MButton Icon="true"
             OnClick="()=>showSearch=!showSearch">
        <MIcon>
            mdi-magnify
        </MIcon>
    </MButton>

    <MButton Icon="true"
             OnClick="()=>showFilter=!showFilter">
        <MIcon>
            @(IsDateFiltered ? "mdi-filter-check-outline" : "mdi-filter-outline")
        </MIcon>
    </MButton>
</MyAppBar>

<ScrollContainer>
    <DiaryCardList @bind-Tags="Tags"
                   Value="Diaries"
                   NotFoundText="@(IsSearchFiltered ? I18n.T("Search.Not Found"):null)" />
</ScrollContainer>

<DateFilterDialog @bind-Visible="showFilter"
                  @bind-Value="dateFilter"
                  OnOK="UpdateDiariesAsync"
                  OnReset="UpdateDiariesAsync">
</DateFilterDialog>
